package YAPclient;

import YAPserver.YAPserver;


/**
 * This class contains the main-method from which the client and server can be started.
 * @param client serverip:serverport or server listenport
 */
public class YAP {

	public static void main(String[] args) {
		if(args.length>0){
			if(args[0].equalsIgnoreCase("server") || args[0].equalsIgnoreCase("s")){
				if(args.length>1 && args[1]!=null)
					YAPserver.createServer(args[1]);
				else
					YAPserver.createServer(null);
			}
			if( args[0].equalsIgnoreCase("client") || args[0].equalsIgnoreCase("c") ){
				if(args.length>1 && args[1]!=null)
					YAPgame.createClient(args[1]);
				else
					YAPgame.createClient(null);
			}
		}
		else{
			YAPgame.createClient(null);
		}

	}

}
